//
//  OptionsViewController.m
//  FIght Game
//
//  Created by iD Student on 7/1/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "OptionsViewController.h"

@interface OptionsViewController ()

@end

@implementation OptionsViewController


- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
    imageList = [[NSMutableArray alloc] init];
    [imageList addObject:[NSString stringWithFormat:@"MONSTER MAN"]];
    [imageList addObject:[NSString stringWithFormat:@"BIG BLOB"]];
    [imageList addObject:[NSString stringWithFormat:@"BAD BAT"]];
    
    
    appsettings = [NSUserDefaults standardUserDefaults];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView
{
    return 1;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
    // The count of items in the array colorList.
    return imageList.count;
}
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
    return [imageList objectAtIndex:row];
}
-(void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
    selectedRow = row;
}
- (IBAction)selection:(id)sender
{
    enemyType = selectedRow;
    [appsettings setInteger:enemyType forKey:@"enemyType"];
    [appsettings synchronize];
    [self.navigationController popViewControllerAnimated:YES];
}

@end
